﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common
{
    public class ConsoleHelper
    {
        public static void ShowError(string errorMsg)
        {
            Show(errorMsg, "Error");
        }
        
        public static void ShowInfo(string infoMsg)
        {
            Show(infoMsg, "Info");
        }

        public static void ShowWarning(string warningMsg)
        {
            Show(warningMsg, "Warning");
        }

        public static void ShowSuccess(string successMsg)
        {
            Show(successMsg, "Success");
        }

        private static void Show(string msg,string type)
        {
            Console.ResetColor();
            switch(type)
            {
                case "Error":
                    Console.ForegroundColor = ConsoleColor.Red; 
                    Console.Write("Error:");
                    break;
                case "Info":
                    Console.ForegroundColor = ConsoleColor.Cyan; 
                    Console.Write("Info:");
                    break;
                case "Warning":
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.Write("Warning:");
                    break;
                case "Success":
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write("Success:");
                    break;
            }

            Console.ResetColor();
            Console.WriteLine(msg);
        }
    }
}
